package com.zrrd;

import java.util.Arrays;

/**
 * @author WanJl
 * @version 1.0
 * @title Demo
 * @description
 * @create 2024/4/21
 */
public class Demo {
    public void method(int a,int b){
        System.out.println(a);
        System.out.println(b);
    }
    //可变参数，实际上是一个数组
    public void m2(int... a){

    }
    //如果方法中有多个参数，包含可变参数，那么可变参必须放到最后。
    public void m3(String s,double... d){
        System.out.println(s);
        System.out.println(Arrays.toString(d));
    }

    public static void main(String[] args) {
        Demo demo = new Demo();
        demo.method(1,2);
        demo.m2(1,2,3,4,5,6,7,8,8,9,5,54,2,2,5,4,4,1,2,2);
        int[] arr={8,9,5,54,2,2,5,4,4,1,2,2};
        demo.m2(arr);

        demo.m3("哈哈哈哈哈",3,4,4,5,87,7,88,5);
    }
}
